package com.mes.common.service;


import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.mes.basicdata.manager.iface.IWorkCenterManager;
import com.mes.basicdata.dao.iface.IWorkCenterDao;
import com.mes.basicdata.domain.WorkCenter;
import com.mes.common.service.BasicService;
import com.mes.common.util.ConfigInfo;
import com.mes.integration.hbydMPM.impl.MpmImportService;

@Service
public class CommonService {

	@Autowired
	ConfigInfo configInfo;
	
	@DataProvider
	public Object importFTPDataFile(Map dataSetMap, Object parameter) throws Exception
	{
		MpmImportService mpmImportService = new MpmImportService();
		
		String remoteFilePath = configInfo.getMpmFtpItemDataFilePath();// MMUtils.getProperty("mpm.ftpItemDataFilePath");
		Map outParameters = new HashMap();
		outParameters.put("result", mpmImportService.importItemDataFile(remoteFilePath));
		return outParameters;
		
		
	}
	
	@DataProvider
	public Object deleteFTPDataFile(Map dataSetMap, Object parameter) throws Exception
	{
		String remoteFilePath = configInfo.getMpmFtpItemDataFilePath();// MMUtils.getProperty("mpm.ftpItemDataFilePath");
		Map outParameters = new HashMap();
//		outParameters.put("result", new MpmImportService().deleteFile(remoteFilePath));
		return outParameters;
		
		
	}
	
}
